package com.ctshk.rpc.order.custom.provider;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ctshk.rpc.order.custom.req.order.CustomOrderIdReq;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

/**
 * <p>
 * 旅客收款 Provider 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-02-24
 */
public class CustomOrderCollectionProvider {

    public String selectListBySelective(IPage<CustomOrderIdReq> page, CustomOrderIdReq req) {
        return new SQL(){{
            SELECT("tsoc.id, tsoc.order_id, tsoc.collection_number, tsoc.schedule_id, tsoc.tourist_id, " +
                    "tsoti.cn_surname, tsoti.cn_name, tsoti.total_receivables,tsoti.total_paid_in,tsoti.remaining_receivables," +
                    "tsoc.paid_in_amount, tsoc.currency_type, tsoc.currency_type_id, tsoc.collection_type, tsoc.collection_type_id, tsoc.collection_way, tsoc.collection_way_id, " +
                    "tsoc.payer, tsoc.remark, tsoc.collection_voucher_num, tsoc.collection_voucher_json, " +
                    "tsoc.status, tsoc.gmt_create, tsoc.create_id ");
            FROM("t_customized_order_collection tsoc");
            LEFT_OUTER_JOIN("t_customized_order_tourist_info tsoti on tsoc.tourist_id = tsoti.id ");
            WHERE("tsoc.order_id = #{req.id}");
        }}.toString();
    }

}
